﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Controls.Maps;
using System.Device.Location;
namespace ScannerDemo
{
    public partial class UserDetail : PhoneApplicationPage
    {
        App App = App.Current as App;
        public UserDetail()
        {
            InitializeComponent();

            /// SET TEXTBLOCK PROPERTY
            GeoCoordinate Location = new GeoCoordinate(Convert.ToDouble(App.Latitude), Convert.ToDouble(App.Longtitude));
            AboutName.Text = "Name : " + App.Loginname + "\n\n" + "Location : " + App.LoginLocation + "\n\n" + "Tel : " + App.LoginCredit;
            AboutName.Text = string.Format("Name : {0}\nAddress : {1}\nTel : {2}\nLatitude : {3}\nLongtitude : {4}",App.Loginname,App.LoginLocation,App.LoginCredit,App.Latitude,App.Longtitude);
            
            /// SET MAP PROPERTIES
            maps.ZoomLevel = 15;
            maps.Center = Location;
            Pushpin Pin = new Pushpin();
            Pin.Location = Location;
            if (maps.Children.Contains(Pin) == false)
            {
                maps.Children.Add(Pin);
            }
        }
    }
}